package com.edoovo.loginservice.application.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;


/**
 * 有 AUTH_USER 角色的请求
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/public")
@PreAuthorize(value = "hasAnyAuthority('AUTH_USER')")
public class AuthController {

    /**
     *
     * @return
     */
    @GetMapping("/auth")
    public String auth() {
    	return "You are already logged in AuthController";
    }
	
}